import express from 'express';
import * as kitapRouter from './kitap.controller';
import { authGuard } from '../auth/auth.middleware';

const router = express.Router();

/**
 * 获取内容;
 */
router.get('/kitap', kitapRouter.index);

/**
 * 获取推荐内容
 */
router.get('/recommend', kitapRouter.recommend);

/**
 * 获取内容(按 ID)
 */
router.get('/kitapCon/:postId', authGuard, kitapRouter.kitapDetail);

/**
 * 创建作者
 */
router.post('/setAuthorCon', kitapRouter.setAuthorCon);

/**
 * 按关键字查询（模糊查询）
 */
router.get('/getKitapByKey', kitapRouter.selectByKey);

/**
 * 创建内容
 */
router.post('/kitap', authGuard, kitapRouter.store);


/**
 * 删除内容
 */
router.delete('/kitap/:postId', authGuard, kitapRouter.destroy);

/**
 * 删除集
 */
router.post('/delkisim', authGuard, kitapRouter.destroyKisim);

/**
 * 修改状态
 */
router.patch('/kitapStatus', kitapRouter.status);

/** 
 * 获取音频
 */
router.get('/getAudio', kitapRouter.getAudio);

/**
 * 统计书本
 */
router.get('/getTotalBook', kitapRouter.getTotalBook);

/**
 * بولۇم نۇمۇرى بلەن ئەسەرگە ئېرىشىش
 */
router.post('/getBolumAudio', kitapRouter.getBolumAudio);


/**
 * 导出路由
 */
export default router;